package logic;

import java.util.Random;
import java.util.Vector;

public class Deck {
	
	private Vector<Card> cardList;
	private Random randomizer;
	
	public Deck() {
		randomizer = new Random();
		cardList = new Vector<Card>();
		
		for(int i=2; i<10;i++) {
			insereOsQuatroNaipes(i+"");
		}
		insereOsQuatroNaipes("D");
		insereOsQuatroNaipes("J");
		insereOsQuatroNaipes("Q");
		insereOsQuatroNaipes("K");
		insereOsQuatroNaipes("A");
	}
	
	private void insereOsQuatroNaipes(String valor) {
		cardList.add(new Card(valor+"C"));
		cardList.add(new Card(valor+"O"));
		cardList.add(new Card(valor+"P"));
		cardList.add(new Card(valor+"E"));
	}

	public int size() {
		return cardList.size();
	}

	public boolean isEmpty() {
		return cardList.isEmpty();
	}

	public Card getCard() {		
		return cardList.remove(randomizer.nextInt(cardList.size())) ;
	}
	
}
